package com.notion.algorithms.datastructures.graph;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class Vertex {
	private int vertexNumber;
	private List<Edge> edgeList = new LinkedList<Edge>();
	@Override
	public int hashCode() {
		return new Integer(this.getVertexNumber()).hashCode();
	}
	public Vertex(int vertexNumber){
		this.vertexNumber = vertexNumber;
	}
	public void addEdge(Edge e){
		edgeList.add(e);
	}
	public List<Edge> getEdgeList(){
		return Collections.unmodifiableList(edgeList);
	}
	public int getVertexNumber() {
		return vertexNumber;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return Integer.toString(vertexNumber);
	}
	@Override
	public boolean equals(Object obj) {
		boolean isEqual = false;
		if(obj instanceof Vertex){
			Vertex v = (Vertex)obj;
			isEqual=(this.getVertexNumber()==v.getVertexNumber());
		}
		return isEqual;
	}
	
}
